import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        StringBuilder sb=new StringBuilder(sc.next());
        if(check(sb)){
            int count=0;
            while (sb.length()>2){
                char ch1=sb.charAt(0);
                int index=sb.lastIndexOf(ch1+"");
                if(index!=0) {
                    count += sb.length()-1 - index;
                    sb.deleteCharAt(index);
                    sb.deleteCharAt(0);
                }else{
                    count+=sb.length()/2;
                    sb.deleteCharAt(0);
                }
            }
            System.out.println(count);
        }else{
            System.out.println("Impossible");
        }
    }
    public static boolean check(StringBuilder sb){
        char[] arr=new char[26];
        for (int i = 0; i < sb.length(); i++) {
            arr[sb.charAt(i)-'a']++;
        }
        int count=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]%2==1){
                count++;
            }
        }
        if(count>1){
            return false;
        }
        return true;
    }
}


